package com.fowo.api.sys.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fowo.api.common.annotaion.TitleField;
import com.fowo.api.sys.entity.enums.SysTaskType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

/**
 * 系统任务列表项
 */
@Data
public class SysTaskItemVo {

    /**
     * 主键编号
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后时间
     */
    private Date lastUpdateTime;

    /**
     * 是否被隐藏（查询分页接口不可见）
     */
    private boolean isHidden;

    /**
     * 是否被保护（不可被删除）
     */
    private boolean isProtected;

    @TitleField
    @Schema(title = "任务标题")
    private String title;

    @Schema(title = "任务编码")
    private String code;

    @Schema(title = "启用计划")
    private Boolean plan;

    @Schema(title = "执行次数")
    private Long executions;

    @Schema(title = "最后执行时间")
    private Date lastExecutionTime;

    @Schema(title = "下次执行时间")
    private Date nextExecutionTime;

    @Schema(title = "任务说明")
    private String description;

    @Schema(title = "状态")
    private Integer status;

    @Schema(title = "任务类型")
    private SysTaskType type;

    @Schema(title = "配置数据")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private SysTaskData data;

    private Long xxlInfoId;
}
